package file;

import java.io.*;

public class FileOutputStream {
    public static void main(String[] agrs){
        InputStream is=System.in;
        File file=new File("e:\\kk.txt");
        System.out.println("请输入吧：");
        try {
            java.io.FileOutputStream fos=new java.io.FileOutputStream(file);
            int c=is.read();
            while (c!='#'){
                if (c==10) fos.write(13);
                fos.write(c);
                c=is.read();
            }
            fos.close();
            System.out.println("已保存到文件！");
            FileInputStream fis=new FileInputStream(file);
            int x=fis.read();
            if (x!=-1){
                System.out.println(x+",");
                x=fis.read();
            }
            fis.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
